package com.nt.train.controller;
import com.nt.train.service.EchoService;
import com.nt.train.service.FinService;
import com.nt.train.service.PcsService;
import com.nt.train.service.impl.DemoMyService;
import com.nt.train.service.impl.NtTestService;
import com.nt.train.utils.ResultUtil;
import com.nt.train.vo.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * https://ld246.com/article/1537345458325
 * https://blog.csdn.net/Merciful_Lion/article/details/124064384
 * @author hlf
 * @version 1.0
 * @date 2022/8/4 9:57
 */
@RestController
@RequestMapping(value = "/pcs")
public class PcsController {

    @Resource
    PcsService pcsService;

    //Spring~用注解读取bean(属性注入、构造方法注入、set注入)

//    //属性注入
//    @Autowired
//    PcsService pcsService;

//    //设置一个字段
//    private PcsService pcsService;
//    //为这个字段生成一个set方法，然后加上注解
//    @Autowired
//    public void setPcsService(PcsService pcsService) {
//        this.userService = userService;
//    }

//    //先生成一个字段
//    private PcsService pcsService;
//
//    //然后生成构造方法，前面加上注解
//    @Autowired
//    public PcsController(PcsService pcsService) {
//        this.pcsService = pcsService;
//    }

    @RequestMapping(value = "/test")
    public ResponseVO echo(String name) {
        return ResultUtil.success("成功",pcsService.getPcsDemo());
    }

}
